-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Gatsby dev to proxy dev-server #280
Conversation
Signed-off-by: James Hadfield <hadfield.james@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @didithilmy -- this solution looks good and should become the go-to method for development inside this repo. I don't have any issues with moving the paths into a separate file. Tested in both dev & production modes and couldn't find any issues.
@eharkins would you mind taking a look 🙏
We should also update the README through this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some updates to the README and static-site/README @jameshadfield. npm run dev
worked for me in my existing checkout of the repo.
However, when I created a fresh clone to try and come up with instructions for the README for running a dev server from scratch, I got inconsistent errors when building the site from scratch, so couldn't come up with a complete set of instructions for running a dev server from scatch. Maybe you or @didithilmy can come up with a complete set of instructions for needs to happen before you can run a dev server if you are starting anew and add them here:
https://github.com/nextstrain/nextstrain.org/pull/280/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R39
?
Can you try running |
Good find -- thanks for running this extra check. I think this occurs because |
I still get
after running the following in a new clone of this branch:
which seems like it should work since it completes the build of the static site (along with installing dependencies) during |
Commit f5f67bc added `http-proxy-middleware` as an explicit dependency, rather than a transitive dependency. This had the side-effect of upgrading the package from v0 to v1, the latter of which no longer exposes the `createProxyMiddleware` function as default, thus we need to use an explicit require to import it. Co-authored-by: Muhammad Aditya Hilmy <didithilmy@gmail.com>
@eharkins this should now be working 🤞 could you re-test please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now, thanks both!
I updated the README and static-site/README to make it explicit that running npm run build
is necessary in both ways of running the server. Feel free to edit my language there.
Closes #158. From #158 (comment):